@extends('front.common.header')

@section('title','企业专区 - 充电加油')
@section('description',(count($now_prof)>0 && !empty($now_prof->description)?trim($now_prof->description).',':''))
@section('keywords',(count($now_prof)>0 && !empty($now_prof->identify)?trim($now_prof->identify).',':'市妇幼保健,精密检验设备,精密齿轮箱的设计与制造,汽车、冰洗电器产品,互联网信息化的“问学”平台技术服务等多企业专区平台,'))

@section('head')
    @parent
    @stop

@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('/css/teaches/jyz.css') }}" />
<link href="{{ asset('/css/teaches/enterprise.css') }}" rel='stylesheet' type='text/css'>
<div class="content">
    <div class='top-nav'>
		<ul>
		  {!! $mianbaoxie !!}
		</ul>
	</div>
</div>
<div class='ent_content'>
	<div class='ent_left fl'>
		<div class='ent-border employ-search clearfix'>
			<div class="search-line" id="search-line">
               <ul>
                   <li class="fist-title">学习方向：</li>
                   <li class="list-nav">
                       <a href="{{url('/teaches')}}">充电加油</a>
                   </li>
                   <li class="">
                       <a href="{{url('/employ/list')}}">就业指南</a>
                   </li>
               </ul>
           </div>
           <div class="search-line bodertop" id="search-line">
               <ul>
                   <li class="fist-title">板块分类：</li>
                   <li @if($id == 1)class="list-nav"@endif>
                       <a href="{{url('/teaches/list/1')}}">职业技能</a>
                   </li>
                   <li @if($id == 2)class="list-nav"@endif>
                       <a href="{{url('/teaches/list/2')}}">推荐机构</a>
                   </li>
                   <li @if($id == 3)class="list-nav"@endif>
                       <a href="{{url('/teaches/list/3')}}">企业专区</a>
                   </li>
               </ul>
           </div>
           <div class="search-line bodertop" id="search-line">
               <ul class="clearfix">
                   <li class="fist-title">行业分类：</li>
                   <li  @if(empty($profid))class="list-nav"@endif>
                       <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof=')}}">全部</a>
                   </li>
                   @foreach($profession as $pk=>$prof)
                   @if($pk < 9)
                   <li @if($profid == $prof->id) class="list-nav" @endif>
                       <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof='.$prof->id)}}">{{$prof->name}}</a>
                   </li>
                   @endif
                   @if($pk>=9 && ($profid == $prof->id))
                    <li class="list-nav" >
                       <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof='.$prof->id)}}">{{$prof->name}}</a>
                   </li>
                   @endif
                   @endforeach
                   @if(count($profession)>9)
                   <div class="float-r has-more position-relative" id="has-more">
                       <div class="icon-img">
                            <img src="{{asset('images/front/more.png')}}">
                       </div>
        	           <div class="search-line to-more-infomation" id="to-more-infomation">
        	               <ul class="clearfix boderbtm-dashed">
        	                   <li class="fist-title">行业分类：</li>
                               <li  @if(empty($profid))class="list-nav"@endif>
                                   <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof=')}}">全部</a>
                               </li>
                               @foreach($profession as $pk=>$prof)
                               @if($pk < 9)
                               <li @if($profid == $prof->id) class="list-nav" @endif>
                                   <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof='.$prof->id)}}">{{$prof->name}}</a>
                               </li>
                               @endif
                               @if($pk>=9 && ($profid == $prof->id))
                                <li class="list-nav" >
                                   <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof='.$prof->id)}}">{{$prof->name}}</a>
                               </li>
                               @endif
                               @endforeach
        	               </ul>
        	               <ul class="clearfix">
        	                   @foreach($profession as $pk=>$prof)
        	                   @if($pk >= 9)
        	                   <li @if($profid == $prof->id) class="list-nav" @endif>
                                   <a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort='.$sort.'&prof='.$prof->id)}}">{{$prof->name}}</a>
                               </li>
        	                   @endif
        	                   @endforeach
        	               </ul>
        	           </div>
                   </div>
                   @endif
               </ul>
           </div>
           <div class="search-line bodertop" id="search-line">
               <ul class="clearfix">
                   <li class="fist-title">选择地区：</li>
                   <li  @if(empty($now_area))class="list-nav"@endif>
                       <a href="{{url('/teaches/list/'.$id.'?areaid=0&sort='.$sort.'&prof='.$profid)}}">全部</a>
                   </li>
                   @foreach($areas as $key=>$area)
                   @if($key < 9)
                   <li @if($now_area == $area->area_id) class="list-nav" @endif>
                       <a href="{{url('/teaches/list/'.$id.'?areaid='.$area->area_id.'&sort='.$sort.'&prof='.$profid)}}">{{$area->title}}</a>
                   </li>
                   @endif
                   @if($key>=9 && ($now_area == $area->area_id))
                    <li class="list-nav" >
                       <a href="{{url('/teaches/list/'.$id.'?areaid='.$area->area_id.'&sort='.$sort.'&prof='.$profid)}}">{{$area->title}}</a>
                   </li>
                   @endif
                   @endforeach
                   @if(count($areas)>9)
                   <div class="float-r has-more position-relative" id="has-more">
                       <div class="icon-img">
                            <img src="{{asset('images/front/more.png')}}">
                       </div>
        	           <div class="search-line to-more-infomation" id="to-more-infomation">
        	               <ul class="clearfix boderbtm-dashed">
        	                   <li class="fist-title">选择地区：</li>
                           <li  @if(empty($now_area))class="list-nav"@endif>
                               <a href="{{url('/teaches/list/'.$id.'?areaid=0&sort='.$sort.'&prof='.$profid)}}">全部</a>
                           </li>
                           @foreach($areas as $key=>$area)
                           @if($key < 9)
                           <li @if($now_area == $area->area_id) class="list-nav" @endif>
                               <a href="{{url('/teaches/list/'.$id.'?areaid='.$area->area_id.'&sort='.$sort.'&prof='.$profid)}}">{{$area->title}}</a>
                           </li>
                           @endif
                           @if($key>=9 && ($now_area == $area->area_id))
                            <li class="list-nav" >
                               <a href="{{url('/teaches/list/'.$id.'?areaid='.$area->area_id.'&sort='.$sort.'&prof='.$profid)}}">{{$area->title}}</a>
                           </li>
                           @endif
                           @endforeach
        	               </ul>
        	               <ul class="clearfix">
        	                   @foreach($areas as $key=>$area)
        	                   @if($key >= 9)
        	                   <li @if($now_area == $area->area_id) class="list-nav" @endif>
        	                       <a href="{{url('/teaches/list/'.$id.'?&areaid='.$area->area_id.'&sort='.$sort.'&prof='.$profid)}}">{{$area->title}}</a>
        	                   </li>
        	                   @endif
        	                   @endforeach
        	               </ul>
        	           </div>
                   </div>
                   @endif
               </ul>
           </div>
		</div>
		<div class="employ-search employ-sort mt-15">
              <div class="search-line">
	           <ul class="clearfix">
	               <li class="@if(empty($sort) || $sort ==  0) list-nav @endif">
        			<a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort=0')}}"><div class='ent-hover'>综合排序</div></a>
          			</li>
    				<li>|</li>
    				<li class="@if($sort == 1) list-nav @endif">
            			<a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort=1')}}"><div class='ent-hover'>浏览人数</div></a>
          			</li>
    				<li>|</li>
    				<li class="@if($sort == 2) list-nav @endif">
            			<a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort=2')}}"><div class='ent-hover'>评论数</div></a>
          			</li>
          			<li>|</li>
          			<li class="@if($sort == 3) list-nav @endif">
            			<a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort=3')}}"><div class='ent-hover'>职位数</div></a>
          			</li>
          			<li>|</li>
          			<li class="@if($sort == 4) list-nav @endif">
            			<a href="{{url('/teaches/list/'.$id.'?areaid='.$now_area.'&sort=4')}}"><div class='ent-hover'>内训数</div></a>
          			</li>
               </ul>
             </div>	
         </div>
		<div class='info_bg fl mt-15'>
			<div class='ent_b_info' id="companylist">
				@foreach($company as $com)
				<div class='ent_s_info fl'>
					<div>
					  <a href="{{url('/teaches/company/'.$com->id)}}"><img src="{{ $com->logo }}"></a>
					</div>
					<div class='info_top'>
						<div class='fl ent4'><a href="{{url('/teaches/company/'.$com->id)}}" title="{{ $com->name }}">{{ str_limit($com->name,14) }}</a></div>
						<div class='fr ent5'>
							已开设<span class='ent6'>{{ $com->teaches_count }}</span>门课程
						</div>
					</div>						
					<p class='info_zp ent3'>正在招聘<span class='ent6'>{{count($com->jobsinfo)?:0}}</span>个职位</p>
					<div class='info_bottom'>
						<ul class='ent5'>
							@if(count($com->tags))
							@foreach($com->tags as $key=>$tag)
                            @if($key < 3)
							<li>
								<div class='info_fuli'>
									@if(count($tag->tags)>0)
									{{$tag->tags->tags_name}}
									@endif
								</div>
							</li>
                            @endif
							@endforeach
							@endif
						</ul>
					</div>
					<div class='info-line'></div>
				</div>
				@endforeach
			</div>
			<!-- 继续加载 -->
			<div class='ent-loading fl'>
				<a href="javascript:void(0)" id="getMores"><div class='ent-jz'>继续加载...</div></a>
				<input type="hidden" name="pages" value="{{$pages}}" />
			</div>
		</div>
	</div>

	<div class='ent_right fr'>
		<div class='ent-rm'>热门企业</div>
		@foreach($hotCompany as $hcomp)
		<div class='ent-rm-info'>
			<div><a href="{{url('/teaches/company/'.$hcomp->id)}}"><img src="{{$hcomp->logo}}" width="218" height="127"></a></div>
			<p class='ent3' style='margin-top:10px'>{{$hcomp->name}}</p>
			<p class='ent5' style='margin-top:5px;margin-bottom:10px'>
				已开设<span class='ent6'>{{$hcomp->teaches_count}}</span>门课程
			</p>
		</div>
		@endforeach
	</div>
</div>
<script type="text/javascript">
<!--
$(function(){
    $('#getMores').click(function(){
        var p = $("input[name=pages]").val();
        var areaid = "{{ Input::get('areaid')}}";
        $.ajax({
            type:'GET',
            url:'/teaches/list/3',
            data:"page="+p+"&areaid="+areaid,
            dataType:'json',
            success:function(data){
                if(data.status == 'success'){
                    var result = data.data;
                    var str = '';
                    var html = '';
                    $.each(result,function(k,e){
                        str ='';
                        $.each(e.comptags,function(key,value){
                            if(key < 3)
                            {
    							str +='<li>'
                    				+'		<div class="info_fuli">'
                    				+ 		value
                    				+'		</div>'
                    				+'</li>';
                            }
                        });
                        var sname = e.name;
                        if(sname.length > 12){
                        	sname = sname.substring(0,12)+"...";
                        }
                    	html +='<div class="ent_s_info fl">'
                				+'	<div>'
                				+'	  <a href="/teaches/company/'+e.id+'"><img src="'+e.logo+'"></a>'
                				+'	</div>'
                				+'	<div class="info_top">'
                				+'		<div class="fl ent4"><a href="/teaches/company/'+e.id+'" title="'+sname+'">'+sname+'</a></div>'
                				+'		<div class="fr ent5">'
                				+'			已开设<span class="ent6">'+e.teachesCount+'</span>门课程'
                				+'		</div>'
                				+'	</div>'				
                				+'	<p class="info_zp ent3">正在招聘<span class="ent6">'+e.jobsCount+'</span>个职位</p>'
                				+'	<div class="info_bottom">'
                				+'		<ul class="ent5">'
                				+str
                				+'		</ul>'
                				+'	</div>'
                				+'	<div class="info-line"></div>'
                				+'</div>';
                    });
                   $("input[name=pages]").val(data.pages);
                $('#companylist').append(html);
                }else{
                    $("#getMores div").html(data.msg);
                }
            }
        });
    });
})
//-->
</script>
@stop

@section('footer')
    @parent
@stop